<?php
class KolSys_RegExp
{
	public static $regExps=array();
	public static function updateRegExps()
	{
		$query=mysql_query("SELECT * FROM `regexps`");
		while($row=mysql_fetch_assoc($query))
		{
			self::$regExps[$row['name']]=$row['value'];
		}
	}
	public static $patterns = array(
	    # General patterns.
	    "whitespace" =>'([\t ]+)',
	    "results" =>'<b>Results:<\/b><\/td><\/tr><tr><td[^<>]*><center><table><tr><td>(.*?)</td></tr></table></center></td></tr>',
	    "htmlComment" =>'<!--.*?-->',
	    "htmlTag" =>'<[^>]*?>',
	
	    # Login-related patterns.
	    "accountPwd" =>'var pwdhash = "([0-9a-f]+)";',
	    "accountId" =>'var playerid = ([0-9]+);',
	    "accountName" =>'<a [^<>]*href="charsheet\.php">(?:<b>)?([^<>]+)<',
	    "badPassword" =>'<b>Login failed\. Bad password\.<\/b>',
	    "loginChallenge" =>'name="?challenge"?\s+value="?([0-9a-f]+)"?',
	    "loginURL" =>'^(.*)login\.php\?loginid=([0-9a-f]+)',
	    "mainFrameset" =>'<frameset id="?rootset"?',
	    "tooManyLoginsFailuresFromThisIP" =>'Too many login failures from this IP',
	    "waitOneMinuteLoginError" =>'Please wait a minute',
	    "waitTwoMinutesLoginError" =>"you'll need to wait a couple of minutes before you can log in again\.",
	    "waitFiveMinutesLoginError" =>"Please wait five minutes and try again\.",
	    "waitFifteenMinutesLoginError" =>'Please wait fifteen minutes and try again\.',
	
	    # Item-related patterns.
	    "menuItem" =>'<input type=radio name=whichitem value="?(-?[0-9]+)"?></td><td><img .*? onclick=\'descitem\("?([^"]+)"?\);\'>',
	    "acquireSingleItem" =>'<td[^>]*><img src="[^"]*" alt="[^"]*" title="[^"]*"[^>]*descitem\(([0-9]+)\)[^>]*><\/td><td[^>]*>You acquire an item',
	    "acquireMultipleItems" =>'<td[^>]*><img src="[^"]*" alt="[^"]*" title="[^"]*"[^>]*descitem\(([0-9]+)\)[^>]*><\/td><td[^>]*>You acquire <b>([0-9,]*) ',
	    "gainMeat" =>'<td><img src="[^"]*meat\.gif"[^>]*><\/td><td[^>]*>You gain ([0-9,]*?) Meat\.<\/td>',
	    "loseMeat" =>'You lose ([0-9,]*?) Meat',
	    "isCocktailcraftingIngredient" => '<br>\(Cocktailcrafting ingredient\)<br>',
	    "isCookingIngredient" =>'<br>\(Cooking ingredient\)<br>',
	    "isJewelrymakingComponent" =>'<br>\(Jewelrymaking component\)<br>',
	    "isMeatsmithingComponent" =>'<br>\(Meatsmithing component\)<br>',
	    "inventorySingleItem" =>'<img [^>]*descitem\(([0-9]+)[^>]*></td><td[^>]*><b[^>]*>([^<>]+)</b>&nbsp;<span><\/span>',
	    "inventoryMultipleItems" =>'<img [^>]*descitem\(([0-9]+)[^>]*></td><td[^>]*><b[^>]*>([^<>]+)</b>&nbsp;<span>\(([0-9]+)\)<\/span>',
	    "itemAutosell" =>'<br>Selling Price: <b>(\d*) Meat\.<\/b>',
	    "itemImage" =>'<img src="http:\/\/images\.kingdomofloathing\.com\/itemimages\/(.*?)"',
	    "itemName" =>'<b>(.+?)<\/b>',
	    "itemType" =>'<br>Type: <b>([^<]*)<\/b><br>',
	    "tooFull" =>"You're too full to eat that\.",
	    "tooDrunk" =>"You're way too drunk already\.",
	    "notBooze" =>"That's not booze\.",
	    "notFood" =>"That's not something you can eat\.",
	    "notEquip" =>"That's not something you can equip\.  And stop screwing with the URLs\.",
	    "notEnoughToUse" =>"<table><tr><td>You don't have that many of that item.</td></tr></table>",
	    "notMultiUse" =>"<table><tr><td>That item isn't usable in quantity.</td></tr></table>",
	
	    # Message-related patterns.
	    "brickMessage" =>"http:\/\/images\.kingdomofloathing\.com\/adventureimages\/(brokewin|bigbrick)\.gif",
	    "candyHeartMessage" =>"http:\/\/images\.kingdomofloathing\.com\/otherimages\/heart\/hearttop\.gif",
	    "coffeeMessage" =>"http:\/\/images\.kingdomofloathing\.com\/otherimages\/heart\/cuptop\.gif",
	    "fullMessage" => '<tr><td[^>]*><input type=checkbox name="sel([0-9]+)".*?<b>[^<]*<\/b> <a href="showplayer\.php\?who=([0-9]+)">([^<]*)<\/a>.*?<b>Date:<\/b>([^<]*?)</b>.*?<blockquote>(.*?)<\/blockquote>',
	    "userInHardcoreRonin" =>'<center><table><tr><td>That player cannot receive Meat or items from other players right now\.',
	    "userIgnoringUs" =>"<center><table><tr><td>This message could not be sent, because you are on that player's ignore list\.<\/td><\/tr><\/table><\/center>",
	    "notEnoughItemsToSend" =>"<center><table><tr><td>You don't have enough of one of the items you're trying to send\.<\/td><\/tr><\/table><\/center>",
	    "messageSent" =>"<td><center>Message sent\.<\/center><\/td>",
	
	    # Error patterns.
	    "cantPulverizeItem" =>"<td>That's not something you can pulverize\.<\/td>",
	    "notEnoughItems" =>"(?:<td>You haven't got that many\.<\/td>)|(?:You don't have the item you're trying to use\.)|(?:You don't have the item you're trying to equip\.)",
	
	    # Chat patterns.
	    "currentChatChannel" =>'<font color="?#?\w+"?>Currently in channel: ([^<>]+)<',
	    "chatLastSeen" =>"lastseen:([0-9]+)",
	    "chatChannel" =>'^<font color="?#?\w+"?>\[([^<>]+)\]<\/font> ',
	    "chatMessage" =>'<b><a target="?mainpane"? href="showplayer\.php\?who=(-?[0-9]+)"><font color="?#?\w+"?>([^<>]+)<\/font>(?:<\/b>|<\/a>|:)* (.*)$',
	    "chatEmote" =>'<b><i><a target="?mainpane"? href="showplayer\.php\?who=([0-9]+)"><font color="?#?\w+"?>([^<>]+)<\/b><\/font><\/a> (.*)<\/i>$',
	    "privateChat" =>'<a target="?mainpane"? href="showplayer\.php\?who=([0-9]+)"><font color="?blue"?><b>([^)]+) \(private\):<\/b><\/font><\/a> <font color="?blue"?>(.*)</font>$',
	    "chatNewKmailNotification" =>'<a target="?mainpane"? href="messages\.php"><font color="?green"?>New message received from <a target="?mainpane"? href=\'showplayer\.php\?who=([0-9]+)\'><font color="?green"?>([^<>]+)<\/font><\/a>\.<\/font><\/a>$',
	    "chatLink" =>'<a target="?_blank"? href="([^"]+)"><font color="?blue"?>\[link\]<\/font><\/a> ',
	    "chatWhoResponse" =>'<table><tr><td class=tiny><center><b>Players in this channel:',
	    "chatWhoPerson" =>'<a target="?mainpane"? href="showplayer\.php\?who=([0-9]+)"><font color="?#?\w+"?>([^<>]+)<\/font><\/a>',
	    "chatLinkedPlayer" =>"<a style='color: #?\w+' href='showplayer\.php\?who=([0-9]+)' target=mainpane>([^<]+)<\/a>",
	    "newChatChannel" =>"<font color=[^>]+>You are now talking in channel: ([^\,]+?)\.<p><p>(.*?)</font>",
	    "chatListenResponse" =>"<font color=[^>]+>Currently listening to channels:(.*?<b>.*?</b>.*?)</font>",
	    "chatListenCurrent" =>"<br>&nbsp;&nbsp;<b>(.*?)</b>",
	    "chatListenOthers" =>"&nbsp;&nbsp;([^<>]*?)<br>",
	    "chatStartListen" =>'<font color=[^>]+>Now listening to channel: ([^>]+)</font>',
	    "chatStopListen" =>'<font color=[^>]+>No longer listening to channel: ([^>]+)</font>',
	    "chatMultiLineStart" =>'<b><a target="?mainpane"? href="showplayer\.php\?who=(-?[0-9]+)"><font color="?#?\w+"?>([^<>]+)<\/font><\/b><\/a>:$',
	    "chatMultiLineEmote" =>'<b><i><a target="?mainpane"? href="showplayer\.php\?who=(-?[0-9]+)"><font color="?#?\w+"?>([^<>]+)<\/b><\/font><\/a>$',
	    "outgoingPrivate" =>'<font color="?blue"?><b>private to <a class=nounder target="?mainpane"? href="?showplayer.php\?who=([0-9]+)"?><font color="?blue"?>(.*?)</font></a></b>:(.*?)</font></br>',
	    "chatPlayerLoggedOn" =>'<font color=green><a target=mainpane href=\'showplayer\.php\?who=([0-9]+)\'><font color=green><b>([^<>]+)<\/b><\/font><\/a> logged on\.<\/font>$',
	    "chatPlayerLoggedOff" =>'<font color=green><a target=mainpane href=\'showplayer\.php\?who=([0-9]+)\'><font color=green><b>([^<>]+)<\/b><\/font><\/a> logged off\.<\/font>$',
	
	    # Clan dungeon patterns.
	    "dungeonActivity" =>'(?:^|<br>|<br><b>|<b>)([^<>]+) \(#([0-9,]+)\) ([^<>]+) \(([0-9,]+) turns?\)',
	    "dungeonLootDistribution" =>'(?:<blockquote>|<br>)([^<>]+) \(#([0-9,]+)\) distributed <b>([^<>]+)</b> to ([^<>]+) \(#([0-9,]+)\)<br>',
	    "dungeonPreviousRun" =>'<tr><td class="?small"?>([^<>]+)&nbsp;&nbsp;<\/td><td class="?small"?>([^<>]+)&nbsp;&nbsp;<\/td><td class="?small"?>([^<>]+)&nbsp;&nbsp;<\/td><td class="?small"?>([0-9,]+)<\/td><td class="?tiny"?>\[<a href="clan_raidlogs\.php\?viewlog=([0-9]+)">view logs<\/a>\]<\/td><\/tr>',
	    "dungeonLogCategory" =>'<b>([^<>]+):<\/b><blockquote>(.*?)<\/blockquote>',
	    "imprisonedByChums" =>'^(.*) has been imprisoned by the C\. H\. U\. M\.s!$',
	    "freedFromChums" =>'^(.*) has rescued (.*) from the C\. H\. U\. M\.s\.$',
	
	    # Cocktailcrafting patterns.
	    "itemsDontMakeCocktail" =>"<td>Those two items don't combine to make a refreshing cocktail\.</td>",
	    "dontHaveSkillToMixCocktail" =>"<td>You don't have the skill necessary to make that cocktail\.</td>",
	    "dontHaveItemsForThatCocktail" =>"<td>You don't have enough of one of the necessary items to make a cocktail that tasty\.</td>",
	    "dontHaveAdventuresToMixCocktail" =>"<td>You don't have that many adventures left\. +It takes <i>time<\/i> to make a good cocktail, man\.</td>",
	
	    # Character Pane patterns.
	    'characterLevel' =>'<br>Level ([0-9]+)<br>(.*?)<table',
	    'characterMuscle' =>'Muscle:</td><td align=left><b>(?:<font color=blue>([0-9]+)</font>)?(?:&nbsp;)?\(?([0-9]+)\)?</b>',
	    'characterMoxie' =>'Moxie:</td><td align=left><b>(?:<font color=blue>([0-9]+)</font>)?(?:&nbsp;)?\(?([0-9]+)\)?</b>',
	    'characterMysticality' =>'Mysticality:</td><td align=left><b>(?:<font color=blue>([0-9]+)</font>)?(?:&nbsp;)?\(?([0-9]+)\)?</b>',
	    'characterHP' =>'onclick=\'doc\("hp"\);\'[^<>]*><br><span class=[^>]+>([0-9]+)&nbsp;/&nbsp;([0-9]+)</span>',
	    'characterMP' =>'onclick=\'doc\("mp"\);\'[^<>]*><br><span class=[^>]+>([0-9]+)&nbsp;/&nbsp;([0-9]+)</span>',
	    'characterMeat' =>'onclick=\'doc\("meat"\);\'[^<>]*><br><span class=black>([0-9,]+)</span>',
	    'characterAdventures' =>'onclick=\'doc\("adventures"\);\'[^<>]*><br><span class=black>([0-9]+)</span>',
	    'currentFamiliar' =>'href="familiar.php">(?:<b>)?<font size=[0-9]+>(.*?)</a>(?:</b>)?, the  ([0-9]+)-pound (.*?)</font></td></tr></table>',
	    'characterEffect' =>'eff\("[a-fA-F0-9]+"\);\'.*?></td><td valign=center><font size=[0-9]+>(.*?) ?\(([0-9]+)\)</font><br></td>',
	    'characterRonin' =>'>Ronin</a>: <b>([0-9]+)</b>',
	    'characterMindControl' =>'>Mind Control</a>: <b>([0-9]{1,2})</b>',
	    'characterDrunk' =>'>(?:Inebriety|Temulency|Tipsiness|Drunkenness):</td><td><b>([0-9]{1,2})</b>',
	
	    # Stat, Substat, Leveling, HP, and MP patterns. Will fail in Haiku Dungeon.
	    'muscleGainLoss' =>'You (gain|lose) ([0-9,]+) (?:Beefiness|Fortitude|Muscleboundness|Strengthliness|Strongness)',
	    'mysticalityGainLoss' =>'You (gain|lose) ([0-9,]+) (?:Enchantedness|Magicalness|Mysteriousness|Wizardliness)',
	    'moxieGainLoss' =>'You (gain|lose) ([0-9,]+) (?:Cheek|Chutzpah|Roguishness|Sarcasm|Smarm)',
	    'musclePointGainLoss' =>'You (gain|lose) (a|some) Muscle points?',
	    'mystPointGainLoss' =>'You (gain|lose) (a|some) Mysticality points?',
	    'moxiePointGainLoss' =>'You (gain|lose) (a|some) Moxie points?',
	    'levelGain' =>'You gain (a|some) (?:L|l)evels?',
	    'hpGainLoss' =>'You (gain|lose) ([0-9,]+) hit points?',
	    'mpGainLoss' =>'You (gain|lose) ([0-9,]+) (?:Muscularity|Mana|Mojo) (?:P|p)oints?',
	
	    # Drunkenness, Adventures, and Effect patterns.
	    'gainDrunk' =>'You gain ([0-9]+) Drunkenness',
	    'gainAdventures' =>'You gain ([0-9,]+) Adventures',
	    'gainEffect' =>'<td valign=center class=effect>You acquire an effect: <b>(.*?)</b><br>\(duration: ([0-9,]+) Adventures\)</td>',
	
	    # Meatpasting patterns.
	    'noMeatpaste' => "<b>Results:</b>.*You don't have any meat paste.*<b>Combine Items:</b>",
	    'itemsDontMeatpaste' =>"<td>Those two items don't combine to make anything interesting\.</td>",
	    'dontHaveItemsMeatpaste' =>"<td>You don't have enough of one the necessary items to make that combination\.</td>",
	    'noMeatForMeatpasting' =>"<td>You don't have enough Meat to make that many\.</td>",
	
	    # Store patterns.
	    'meatSpent' =>'You spent ([0-9,]+) Meat',
	    'noMeatForStore' =>"(?:You can't afford that many of that item)|(?:You can't afford that item)|(?:You can't afford to purchase that)",
	    'invalidStore' =>"You've been sent back here by some kind of bug",
	    'notSoldHere' =>"(?:This store doesn't sell that item)|(?:Invalid item selected)",
	    "storeInventory" =>'width=30 height=30><\/td><td>([^<>]+?)(?: \(([0-9]+)\))?<\/td><td>([0-9,]+)</td><td>([^.]*)</td><td><a href="managestore.php\?action=take&whichitem=([0-9]+)">',
	
	    # Hermit patterns.
	    'noTrinkets' =>"You don't have enough stuff",
	    'noHermitPermits' =>"You don't have enough Hermit Permits to trade for that many",
	    'notEnoughClovers' =>"you are able to infer that he doesn't have enough clovers to make that trade",
	    'notHermitItem' =>"The Hermit doesn't have that item",
	
	    # Adventure patterns.
	    "twiddlingThumbs" =>"You twiddle your thumbs\.",
	    "userShouldNotBeHere" =>"(?:>You shouldn't be here\.<)|(?:)>This is not currently available to you\.<",
	    "monsterName" =>"<span id='monname'>(.*?)<\/span>",
	    "choiceIdentifier" =>'<input type="?hidden"? name="?whichchoice"? value="?([0-9]+)"?>',
	    "choiceName" =>"<b>([^<>]+?)<\/b><\/td><\/tr>",
	    "noncombatName" =>"<center><table><tr><td><center><b>([^<>]+)<\/b><br><img",
	    "fightWon" =>"<center>You win the fight!<!--WINWINWIN--><p>",
	    "fightLost" =>"<p>You lose\. +You slink away, dejected and defeated\.<p>",
	    "usedBarrel" =>"KOMPRESSOR does not smash",
	    "noAdventures" =>"You're out of adventures",
	
	    # Rumpus Room patterns.
	    'rumpusRoomFurniture' =>'rump([0-9])_([0-9])\.gif',
	
	    # Mall search patterns.
	    "mallItemSearchResult" =>'<tr class="graybelow(.*?)<\/tr>',
	    "mallItemSearchDetails" =>'<a[^<>]*href="mallstore\.php\?whichstore=(?P<storeId>[0-9]+)&searchitem=(?P<itemId>[0-9]+)&searchprice=(?P<price>[0-9]+)"><b>(?P<storeName>.*?)<\/b><\/a>[^<>]*<\/td><td[^<>]*>(?P<quantity>[0-9,]+)<\/td><td[^<>]*>(?:&nbsp;)*(?P<limit>[0-9,]*)[^<>]*<\/td>',
	
	    # Mall purchase patterns.
	    "cantAffordItem" =>"<td>You can't afford that item\.<\/td>",
	    "mallNoItemAtThatPrice" =>"<td>This store doesn't have that item at that price\.",
	    "cantBuyItemIgnoreList" =>"<td>That player will not sell to you, because you are on his or her ignore list\.<\/td>",
	    "mallHitLimit" =>"You may only buy ([0-9,]+) of this item per day from this store\. You have already purchased ([0-9,]+) in the last 24 hours\.",
	
	    # Canadia patterns.
	    "noAdvInstitue" =>">You don't have that many Adventures\.  Take off, eh\?<",
	    "invalidAdvInstitute" =>">That doesn't make any sense, you hoser\.<",
	
	    # Guild patterns.
	    'skillNotTrainable' =>'>Invalid skill selected\.<',
	    'skillTooWeak' =>">You're not powerful enough to train that skill\.<",
	    'skillTooPoor' =>">You can't afford to train that skill\.<",
	    'skillLearned' =>">You learn a new skill: <b>(.*?)</b>",
	    'skillHaveAlready' =>">You've already got that skill\.<",
	
	    # Equipment patterns
	    "currentHat" =>"Hat</a>:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentWeapon" =>"Weapon</a>:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentOffhand" =>"Offhand</a>:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentShirt" =>"Shirt</a>:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentPants" =>"Pants</a>:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentAcc" =>"Accessory</a>:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentAcc1" =>"Accessory</a>&nbsp;1:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentAcc2" =>"Accessory</a>&nbsp;2:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentAcc3" =>"Accessory</a>&nbsp;3:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	    "currentFam" =>"Familiar</a>:</td><td><img src=\"[^\"]+\" class=hand onClick='descitem\(([0-9]+)\)'",
	
	    # Autosell patterns.
	    "autosellResponse" =>"You sell your (.*?) to (?:.*?) for ([0-9,]+) Meat.",
	    "autosellItems" =>" ([0-9,]*) ?(.*?),",
	    "autosellLastTwo" =>" ([0-9,]*) ?(.*?) and your ([0-9,]*) ?(.*?)$",
	    "autosellOne" =>"([0-9,]*) ?(.*?)$",
	
	    # Uneffect patterns.
	    "effectRemoved" =>"<td>Effect removed\.<\/td>",
	    "youDontHaveThatEffect" =>"<td>You don't have that effect\.",
	    "youDontHaveSGEEA" =>"<td>You don't have a green soft eyedrop echo antidote\.",
	
	    # Ascension History patterns.
	    "fullAscension" =>'</tr><td[^>]*>([0-9]+).*?</td><td[^>]*>([0-9/]+).*?</td><td[^>]*><span[^>]*>([0-9,]+).*?</span>.*?</td><td[^>]*><img [^>]*title="(.*?)"[^>]*></td><td[^>]*>(.*?)</td><td[^>]*>(<span[^>]*>)?([0-9,]+)(</span>)?</td><td[^>]*>(<span[^>]*>)?([0-9,]+)(</span>)?</td><td[^>]*><img [^>]*title="(.*?)"[^>]*></td><td[^>]*>(<img [^>]*title="(.*?)"[^>]*>|<img src="http://images.kingdomofloathing.com/otherimages/spacer.gif" width=30 height=30>)(<img [^>]*title="(.*?)"[^>]*>|</td>)',
	    "familiarAscension" =>'^(.*?) \(([0-9.]+)%\)',
	    "playerName" =>'Ascension History \(<a[^>]*><font[^>]*>(.*?)<\/font><\/a>\)',
	    
	    # User Profile patterns.
	    "profileUserName" =>'<td valign="?center"?>(?:<center>)?<b>([^<>]+)<\/b> \(#[0-9]+\)<br>',
	    "profileClan" =>'<a class=nounder href="showclan\.php\?whichclan=([0-9]+)">(.*?)<\/a>',
	    "profileNumAscensions" =>'Ascensions<\/a>:<\/b><\/td><td>([0-9,]+)<\/td>',
	    "profileNumTrophies" =>'Trophies Collected:<\/b><\/td><td>([0-9,]+)<\/td>',
	    "profileNumTattoos" =>'Tattoos Collected:<\/b><\/td><td>([0-9,]+)<\/td>',
	
	    # Clan patterns.
	    "clanName" =>'<a href="clan_hall\.php">([^<>]*)<\/a>',
	    "clanCredo" =>'<textarea name=newcredo[^<>]*>([^<>]*)</textarea>',
	    "clanWebsite" =>'<input type=text class=text name=website value="([^"]*)" size=60 maxlength=255>',
	    "clanAcceptingApps" =>'<p>Your clan is currently accepting applications\.<br>',
	    "clanRankContainer" =>'<select name=level[0-9]+>(.*?)<\/select>',
	    "clanRank" =>'<option value=([0-9]+)(?: selected)?>(.*?) \(&deg;([0-9]+)\)<\/option>',
	    "clanWhitelistMember" =>'<tr><td><input type=hidden name=player[0-9]+ value=[0-9]+><a href=\'showplayer\.php\?who=(?P<userId>[0-9]+)\' class=nounder><b>(?P<userName>[^<>]+)</b> \(#[0-9]+\)<\/a><\/td><td>(?:<select.*?<option value=(?P<clanRankId>[0-9]+) selected>.*?<\/select>|(?P<clanRankName>[^<>]+))<\/td><td>(?:<input type=text class=text size=[0-9]+ name=title[0-9]+ value=")?(?P<clanTitle>[^<>]+)(?:">)?<\/td>',
	    "clanLogEntry" =>'>(?P<date>[0-9/]+, [0-9:]+(?:AM|PM)): (?:<a class=nounder href=\'showplayer\.php\?who=[0-9]+\'>)?(?P<userName>[^<>]+) \(#(?P<userId>[0-9]+)\)(?:<\/a>)? (?P<action>.*?)<br>',
	    "clanLogFax" =>'faxed in a (?P<monsterName>.*)$',
	    "clanLogAttack" =>'launched an attack against (?P<clanName>.*)\.$',
	    "clanLogWhitelistAdd" =>'added <a class=nounder href=\'showplayer\.php\?who=[0-9]+\'>(?P<userName>.*) \(#(?P<userId>[0-9]+)\)<\/a> to the clan\'s whitelist\.$',
	    "clanLogPlayerJoinedAnotherClan" =>'joined another clan\.$',
	    "clanLogPlayerJoinedClanWhitelist" =>'was accepted into the clan \(whitelist\)$',
	    "clanLogStashItemAdd" =>'added (?P<quantity>[0-9,]+) (?P<itemName>.*)\.$',
	    "clanLogStashItemRemove" =>'took (?P<quantity>[0-9,]+) (?P<itemName>.*)\.$',
	    "clanLogMeatSpentArmy" =>'spent (?P<meat>[0-9,]+) Meat on the clan army\.$',
	    "clanLogChangedRank" =>'changed Rank for <a class=nounder href=\'showplayer\.php\?who=[0-9]+\'>(?P<userName>.*) \(#(?P<userId>[0-9]+)\)<\/a>\.$',
	    "clanLogChangedTitle" =>'changed title for <a class=nounder href=\'showplayer\.php\?who=[0-9]+\'>(?P<userName>.*) \(#(?P<userId>[0-9]+)\)<\/a>\. \((?P<clanTitle>.*)\)$',
	    
	    # Search player Patterns
	    "searchPlayers" =>'showplayer\.php\?who=([0-9]+)">([^<]*)<\/a>',
	);
	
	public static function get($str)
	{
		if(!sizeof(self::$regExps))
		{
			self::updateRegExps();
		}
		//return self::$patterns[$str];
		return self::$regExps[$str];
	}

	public static function getObj($str)
	{
		if(!sizeof(self::$regExps))
		{
			self::updateRegExps();
		}
		//return new KolSys_RegExp_Methods(self::$patterns[$str]);
		return new KolSys_RegExp_Methods(self::$regExps[$str]);
	}
		
}